package com.gitee.feizns.web.utils;

import org.springframework.core.LocalVariableTableParameterNameDiscoverer;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;

/**
 * @author feizns
 * @since 2019/7/21
 */
public abstract class ParamsUtils {

    private static final LocalVariableTableParameterNameDiscoverer DISCOVERER = new LocalVariableTableParameterNameDiscoverer();

    public static final String[] getNames(Method method) {
        return DISCOVERER.getParameterNames(method);
    }

    public static final String[] getNames(Constructor constructor) {
        return DISCOVERER.getParameterNames(constructor);
    }

}
